home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _C93B0C314A464CF58B998A621D5D39EF < prev    next >
Text File  |  2005-07-30  |  974b  |  58 lines

  1. //show parts starting from left to right
  2. //Luke Lenhart
  3. //(C)2004-2005 Digipen Institute of Technology
  4.  
  5. //texture sampler
  6. sampler2D sampTex;
  7.  
  8. //max x position to show
  9. float maxX;
  10. float maxZ;
  11.  
  12. //shader input
  13. struct PS_INPUT
  14. {
  15.     float4 Color : COLOR;
  16.     float2 Tex0 : TEXCOORD0;
  17.     float4 Pos : TEXCOORD1;
  18. };
  19.  
  20. //shader code
  21. float4 PShader(PS_INPUT In) : COLOR
  22. {
  23. /*
  24.     clip(In.Pos.x-maxX);
  25.  
  26.     
  27.     //mod vert color with texture color
  28.     float4 clr;
  29.     float4 texclr=tex2D(sampTex,In.Tex0);
  30.     
  31.     //clr.xyz=texclr.xyz*In.Color.xyz;
  32.     clr.xyz=1-(1-texclr.xyz)*In.Color.xyz;
  33.     
  34.     //alpha based on x
  35.     clr.a=saturate((In.Pos.x-maxX)*1.5f)*texclr.a;
  36.     
  37.     //spit out color
  38.     return clr;
  39. */
  40.  
  41.     //??? ... !
  42.     float4 clr;
  43.     float4 texclr=tex2D(sampTex,In.Tex0);
  44.     
  45.     if(texclr.g<0.715f)
  46.     {
  47.         clr.xyz = lerp(In.Color.xyz,1,(maxZ-In.Pos.z)/maxZ);
  48.     }
  49.     else
  50.         clr.xyz = texclr.xyz;
  51.     
  52.     clr.a=(In.Pos.x-maxX)*texclr.a;
  53.     
  54.     //spit out color
  55.     return clr;
  56.     
  57. }
  58.